package com.flowsoft.security;
...
import com.flowsoft.wanda.WandaService;
...
public class WandaAuthenticationProvider implements AuthenticationProvider,
		Serializable {
	...
	@Override
	public Authentication authenticate(Authentication authentication)
			throws AuthenticationException {

		WandaService controller = new WandaServiceImplService().getWandaServicePort();
		user = controller.findByUsername(authentication.getName());

		if (authentication.getCredentials().equals(user.getPassword())) {
			UsernamePasswordAuthenticationToken t = new UsernamePasswordAuthenticationToken(
					user.getUsername(), user.getPassword(), user.getAuthorities());
			return t;
		} else {
			throw new BadCredentialsException("Try again");
		}
	}

	@Override
	public boolean supports(Class<?> authentication) {
		return (UsernamePasswordAuthenticationToken.class.isAssignableFrom(authentication));
	}
...
}